package ss.pku.jsa.worklist.graph;

public abstract class DirectedGraph<T> {
	protected int[][] matrix;
	protected T[] vertical;

	public DirectedGraph(T[] vertical) {
		matrix = new int[vertical.length][vertical.length];
		this.vertical = vertical;
		this.buildGraph();
	}

	public void buildGraph() {
		for (int i = 0; i < matrix.length; ++i) {
			for (int j = 0; j < matrix.length; ++j) {
				matrix[i][j] = isDirectConnected(vertical[i], vertical[j]);
			}
		}
	}

	public abstract int isDirectConnected(T a, T b);

}
